home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / thor25_arexx.lha / GoldED / ASCIIPic.ged next >
Text File  |  1995-06-13  |  1KB  |  41 lines

  1. /* ASCIIPic.ged by Troels Walsted Hansen
  2. ** $VER: ASCIIPic.ged v1.00 (09.06.95)
  3. **
  4. ** Convert picture to ASCII and include it in GoldED. Uses
  5. ** 'ilbm2ascii' v1.4 by Tobias Ferber.
  6. */
  7.  
  8. options results
  9.  
  10. /* needs GoldED functions */
  11.  
  12. if(substr(address(),1,6) ~= "GOLDED") then
  13. do
  14.     say "This script should only be started from inside GoldED."
  15.     exit 20
  16. end
  17. else gedport = address()
  18.  
  19. /* request a filename, convert to ascii and include in GoldED */
  20.  
  21. address(gedport)
  22. REQUEST TITLE '"Select ILBM to convert and include:"' FILE PATH '"HD3:Bilder/"' MASK '"#?"' VAR picfile
  23. if(rc ~= 0) then exit
  24.  
  25. lastchar = right(picfile,1)
  26. if(rc ~= 0 | lastchar = "/" | lastchar = ":" | picfile = "") then exit
  27.  
  28. address command "run >nil: ilbm2ascii "||'"'picfile'"'||" >t:FSEASCIIPicture"
  29.  
  30. /* a silly hack to avoid ilbm2ascii outputting "done." to GED's output window */
  31.  
  32. do 500
  33.     address command "wait 3"
  34.     if(exists(picfile)) then break
  35. end
  36.  
  37. OPEN NAME '"t:FSEASCIIPicture"' FAST INSERT
  38.  
  39. address command "delete >nil: t:FSEASCIIPicture"
  40. exit
  41.